package com.gdty.lic.utils;

import com.gdty.lic.vo.LicenseCheckModel;

import java.util.Map;

public class LicUtils {

    /**
     * 生成RSA密钥对
     * @return Map key ["privateKey","publicKey"]
     */
    public static Map<String,String> generateKeyPair(){
        return LicenseUtils.generateKeyPair();
    }

    /**
     * 生成License证书
     * @param key ["privateKey","publicKey"]
     * @param model LicenseCheckModel
     * @return String 密文
     */
    public static String generateLicense(Map<String,String> key, LicenseCheckModel model){
        return LicenseUtils.generateLicense(key,model);
    }

    /**
     * 验证并返回信息
     * @param ciphertext 密文
     * @return LicenseCheckModel
     */
    public static LicenseCheckModel verify(String ciphertext) throws Exception{
        return LicenseUtils.verify(ciphertext);
    }

}
